3.590 \(\int \frac{(d+e x)^2 (a+c x^2)}{\sqrt{f+g x}} \, dx\)

Optimal. Leaf size=175 \[ \frac{2 (f+g x)^{5/2} \left (a e^2 g^2+c \left (d^2 g^2-6 d e f g+6 e^2 f^2\right )\right )}{5 g^5}+\frac{2 \sqrt{f+g x} \left (a g^2+c f^2\right ) (e f-d g)^2}{g^5}-\frac{4 (f+g x)^{3/2} (e f-d g) \left (a e g^2+c f (2 e f-d g)\right )}{3 g^5}-\frac{4 c e (f+g x)^{7/2} (2 e f-d g)}{7 g^5}+\frac{2 c e^2 (f+g x)^{9/2}}{9 g^5} \]

[Out]

(2*(e*f - d*g)^2*(c*f^2 + a*g^2)*Sqrt[f + g*x])/g^5 - (4*(e*f - d*g)*(a*e*g^2 + c*f*(2*e*f - d*g))*(f + g*x)^(
3/2))/(3*g^5) + (2*(a*e^2*g^2 + c*(6*e^2*f^2 - 6*d*e*f*g + d^2*g^2))*(f + g*x)^(5/2))/(5*g^5) - (4*c*e*(2*e*f
- d*g)*(f + g*x)^(7/2))/(7*g^5) + (2*c*e^2*(f + g*x)^(9/2))/(9*g^5)

________________________________________________________________________________________

Rubi [A]  time = 0.237012, antiderivative size = 175, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {898, 1153} \[ \frac{2 (f+g x)^{5/2} \left (a e^2 g^2+c \left (d^2 g^2-6 d e f g+6 e^2 f^2\right )\right )}{5 g^5}+\frac{2 \sqrt{f+g x} \left (a g^2+c f^2\right ) (e f-d g)^2}{g^5}-\frac{4 (f+g x)^{3/2} (e f-d g) \left (a e g^2+c f (2 e f-d g)\right )}{3 g^5}-\frac{4 c e (f+g x)^{7/2} (2 e f-d g)}{7 g^5}+\frac{2 c e^2 (f+g x)^{9/2}}{9 g^5} \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x)^2*(a + c*x^2))/Sqrt[f + g*x],x]

[Out]

(2*(e*f - d*g)^2*(c*f^2 + a*g^2)*Sqrt[f + g*x])/g^5 - (4*(e*f - d*g)*(a*e*g^2 + c*f*(2*e*f - d*g))*(f + g*x)^(
3/2))/(3*g^5) + (2*(a*e^2*g^2 + c*(6*e^2*f^2 - 6*d*e*f*g + d^2*g^2))*(f + g*x)^(5/2))/(5*g^5) - (4*c*e*(2*e*f
- d*g)*(f + g*x)^(7/2))/(7*g^5) + (2*c*e^2*(f + g*x)^(9/2))/(9*g^5)

Rule 898

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> With[{q = De
nominator[m]}, Dist[q/e, Subst[Int[x^(q*(m + 1) - 1)*((e*f - d*g)/e + (g*x^q)/e)^n*((c*d^2 + a*e^2)/e^2 - (2*c
*d*x^q)/e^2 + (c*x^(2*q))/e^2)^p, x], x, (d + e*x)^(1/q)], x]] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*
g, 0] && NeQ[c*d^2 + a*e^2, 0] && IntegersQ[n, p] && FractionQ[m]

Rule 1153

Int[((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(
d + e*x^2)^q*(a + b*x^2 + c*x^4)^p, x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 -
b*d*e + a*e^2, 0] && IGtQ[p, 0] && IGtQ[q, -2]

Rubi steps

\begin{align*} \int \frac{(d+e x)^2 \left (a+c x^2\right )}{\sqrt{f+g x}} \, dx &=\frac{2 \operatorname{Subst}\left (\int \left (\frac{-e f+d g}{g}+\frac{e x^2}{g}\right )^2 \left (\frac{c f^2+a g^2}{g^2}-\frac{2 c f x^2}{g^2}+\frac{c x^4}{g^2}\right ) \, dx,x,\sqrt{f+g x}\right )}{g}\\ &=\frac{2 \operatorname{Subst}\left (\int \left (\frac{(-e f+d g)^2 \left (c f^2+a g^2\right )}{g^4}+\frac{2 (e f-d g) \left (-a e g^2-c f (2 e f-d g)\right ) x^2}{g^4}+\frac{\left (a e^2 g^2+c \left (6 e^2 f^2-6 d e f g+d^2 g^2\right )\right ) x^4}{g^4}-\frac{2 c e (2 e f-d g) x^6}{g^4}+\frac{c e^2 x^8}{g^4}\right ) \, dx,x,\sqrt{f+g x}\right )}{g}\\ &=\frac{2 (e f-d g)^2 \left (c f^2+a g^2\right ) \sqrt{f+g x}}{g^5}-\frac{4 (e f-d g) \left (a e g^2+c f (2 e f-d g)\right ) (f+g x)^{3/2}}{3 g^5}+\frac{2 \left (a e^2 g^2+c \left (6 e^2 f^2-6 d e f g+d^2 g^2\right )\right ) (f+g x)^{5/2}}{5 g^5}-\frac{4 c e (2 e f-d g) (f+g x)^{7/2}}{7 g^5}+\frac{2 c e^2 (f+g x)^{9/2}}{9 g^5}\\ \end{align*}

Mathematica [A]  time = 0.154785, size = 149, normalized size = 0.85 \[ \frac{2 \sqrt{f+g x} \left (63 (f+g x)^2 \left (a e^2 g^2+c \left (d^2 g^2-6 d e f g+6 e^2 f^2\right )\right )+315 \left (a g^2+c f^2\right ) (e f-d g)^2-210 (f+g x) (e f-d g) \left (a e g^2+c f (2 e f-d g)\right )-90 c e (f+g x)^3 (2 e f-d g)+35 c e^2 (f+g x)^4\right )}{315 g^5} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x)^2*(a + c*x^2))/Sqrt[f + g*x],x]

[Out]

(2*Sqrt[f + g*x]*(315*(e*f - d*g)^2*(c*f^2 + a*g^2) - 210*(e*f - d*g)*(a*e*g^2 + c*f*(2*e*f - d*g))*(f + g*x)
+ 63*(a*e^2*g^2 + c*(6*e^2*f^2 - 6*d*e*f*g + d^2*g^2))*(f + g*x)^2 - 90*c*e*(2*e*f - d*g)*(f + g*x)^3 + 35*c*e
^2*(f + g*x)^4))/(315*g^5)

________________________________________________________________________________________

Maple [A]  time = 0.048, size = 215, normalized size = 1.2 \begin{align*}{\frac{70\,c{e}^{2}{x}^{4}{g}^{4}+180\,cde{g}^{4}{x}^{3}-80\,c{e}^{2}f{g}^{3}{x}^{3}+126\,a{e}^{2}{g}^{4}{x}^{2}+126\,c{d}^{2}{g}^{4}{x}^{2}-216\,cdef{g}^{3}{x}^{2}+96\,c{e}^{2}{f}^{2}{g}^{2}{x}^{2}+420\,ade{g}^{4}x-168\,a{e}^{2}f{g}^{3}x-168\,c{d}^{2}f{g}^{3}x+288\,cde{f}^{2}{g}^{2}x-128\,c{e}^{2}{f}^{3}gx+630\,a{d}^{2}{g}^{4}-840\,adef{g}^{3}+336\,a{e}^{2}{f}^{2}{g}^{2}+336\,c{d}^{2}{f}^{2}{g}^{2}-576\,cde{f}^{3}g+256\,c{e}^{2}{f}^{4}}{315\,{g}^{5}}\sqrt{gx+f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)^2*(c*x^2+a)/(g*x+f)^(1/2),x)

[Out]

2/315*(g*x+f)^(1/2)*(35*c*e^2*g^4*x^4+90*c*d*e*g^4*x^3-40*c*e^2*f*g^3*x^3+63*a*e^2*g^4*x^2+63*c*d^2*g^4*x^2-10
8*c*d*e*f*g^3*x^2+48*c*e^2*f^2*g^2*x^2+210*a*d*e*g^4*x-84*a*e^2*f*g^3*x-84*c*d^2*f*g^3*x+144*c*d*e*f^2*g^2*x-6
4*c*e^2*f^3*g*x+315*a*d^2*g^4-420*a*d*e*f*g^3+168*a*e^2*f^2*g^2+168*c*d^2*f^2*g^2-288*c*d*e*f^3*g+128*c*e^2*f^
4)/g^5

________________________________________________________________________________________

Maxima [A]  time = 0.984542, size = 266, normalized size = 1.52 \begin{align*} \frac{2 \,{\left (35 \,{\left (g x + f\right )}^{\frac{9}{2}} c e^{2} - 90 \,{\left (2 \, c e^{2} f - c d e g\right )}{\left (g x + f\right )}^{\frac{7}{2}} + 63 \,{\left (6 \, c e^{2} f^{2} - 6 \, c d e f g +{\left (c d^{2} + a e^{2}\right )} g^{2}\right )}{\left (g x + f\right )}^{\frac{5}{2}} - 210 \,{\left (2 \, c e^{2} f^{3} - 3 \, c d e f^{2} g - a d e g^{3} +{\left (c d^{2} + a e^{2}\right )} f g^{2}\right )}{\left (g x + f\right )}^{\frac{3}{2}} + 315 \,{\left (c e^{2} f^{4} - 2 \, c d e f^{3} g - 2 \, a d e f g^{3} + a d^{2} g^{4} +{\left (c d^{2} + a e^{2}\right )} f^{2} g^{2}\right )} \sqrt{g x + f}\right )}}{315 \, g^{5}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2*(c*x^2+a)/(g*x+f)^(1/2),x, algorithm="maxima")

[Out]

2/315*(35*(g*x + f)^(9/2)*c*e^2 - 90*(2*c*e^2*f - c*d*e*g)*(g*x + f)^(7/2) + 63*(6*c*e^2*f^2 - 6*c*d*e*f*g + (
c*d^2 + a*e^2)*g^2)*(g*x + f)^(5/2) - 210*(2*c*e^2*f^3 - 3*c*d*e*f^2*g - a*d*e*g^3 + (c*d^2 + a*e^2)*f*g^2)*(g
*x + f)^(3/2) + 315*(c*e^2*f^4 - 2*c*d*e*f^3*g - 2*a*d*e*f*g^3 + a*d^2*g^4 + (c*d^2 + a*e^2)*f^2*g^2)*sqrt(g*x
 + f))/g^5

________________________________________________________________________________________

Fricas [A]  time = 1.7991, size = 452, normalized size = 2.58 \begin{align*} \frac{2 \,{\left (35 \, c e^{2} g^{4} x^{4} + 128 \, c e^{2} f^{4} - 288 \, c d e f^{3} g - 420 \, a d e f g^{3} + 315 \, a d^{2} g^{4} + 168 \,{\left (c d^{2} + a e^{2}\right )} f^{2} g^{2} - 10 \,{\left (4 \, c e^{2} f g^{3} - 9 \, c d e g^{4}\right )} x^{3} + 3 \,{\left (16 \, c e^{2} f^{2} g^{2} - 36 \, c d e f g^{3} + 21 \,{\left (c d^{2} + a e^{2}\right )} g^{4}\right )} x^{2} - 2 \,{\left (32 \, c e^{2} f^{3} g - 72 \, c d e f^{2} g^{2} - 105 \, a d e g^{4} + 42 \,{\left (c d^{2} + a e^{2}\right )} f g^{3}\right )} x\right )} \sqrt{g x + f}}{315 \, g^{5}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2*(c*x^2+a)/(g*x+f)^(1/2),x, algorithm="fricas")

[Out]

2/315*(35*c*e^2*g^4*x^4 + 128*c*e^2*f^4 - 288*c*d*e*f^3*g - 420*a*d*e*f*g^3 + 315*a*d^2*g^4 + 168*(c*d^2 + a*e
^2)*f^2*g^2 - 10*(4*c*e^2*f*g^3 - 9*c*d*e*g^4)*x^3 + 3*(16*c*e^2*f^2*g^2 - 36*c*d*e*f*g^3 + 21*(c*d^2 + a*e^2)
*g^4)*x^2 - 2*(32*c*e^2*f^3*g - 72*c*d*e*f^2*g^2 - 105*a*d*e*g^4 + 42*(c*d^2 + a*e^2)*f*g^3)*x)*sqrt(g*x + f)/
g^5

________________________________________________________________________________________

Sympy [A]  time = 61.3772, size = 673, normalized size = 3.85 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)**2*(c*x**2+a)/(g*x+f)**(1/2),x)

[Out]

Piecewise((-(2*a*d**2*f/sqrt(f + g*x) + 2*a*d**2*(-f/sqrt(f + g*x) - sqrt(f + g*x)) + 4*a*d*e*f*(-f/sqrt(f + g
*x) - sqrt(f + g*x))/g + 4*a*d*e*(f**2/sqrt(f + g*x) + 2*f*sqrt(f + g*x) - (f + g*x)**(3/2)/3)/g + 2*a*e**2*f*
(f**2/sqrt(f + g*x) + 2*f*sqrt(f + g*x) - (f + g*x)**(3/2)/3)/g**2 + 2*a*e**2*(-f**3/sqrt(f + g*x) - 3*f**2*sq
rt(f + g*x) + f*(f + g*x)**(3/2) - (f + g*x)**(5/2)/5)/g**2 + 2*c*d**2*f*(f**2/sqrt(f + g*x) + 2*f*sqrt(f + g*
x) - (f + g*x)**(3/2)/3)/g**2 + 2*c*d**2*(-f**3/sqrt(f + g*x) - 3*f**2*sqrt(f + g*x) + f*(f + g*x)**(3/2) - (f
 + g*x)**(5/2)/5)/g**2 + 4*c*d*e*f*(-f**3/sqrt(f + g*x) - 3*f**2*sqrt(f + g*x) + f*(f + g*x)**(3/2) - (f + g*x
)**(5/2)/5)/g**3 + 4*c*d*e*(f**4/sqrt(f + g*x) + 4*f**3*sqrt(f + g*x) - 2*f**2*(f + g*x)**(3/2) + 4*f*(f + g*x
)**(5/2)/5 - (f + g*x)**(7/2)/7)/g**3 + 2*c*e**2*f*(f**4/sqrt(f + g*x) + 4*f**3*sqrt(f + g*x) - 2*f**2*(f + g*
x)**(3/2) + 4*f*(f + g*x)**(5/2)/5 - (f + g*x)**(7/2)/7)/g**4 + 2*c*e**2*(-f**5/sqrt(f + g*x) - 5*f**4*sqrt(f
+ g*x) + 10*f**3*(f + g*x)**(3/2)/3 - 2*f**2*(f + g*x)**(5/2) + 5*f*(f + g*x)**(7/2)/7 - (f + g*x)**(9/2)/9)/g
**4)/g, Ne(g, 0)), ((a*d**2*x + a*d*e*x**2 + c*d*e*x**4/2 + c*e**2*x**5/5 + x**3*(a*e**2 + c*d**2)/3)/sqrt(f),
 True))

________________________________________________________________________________________

Giac [A]  time = 1.12678, size = 328, normalized size = 1.87 \begin{align*} \frac{2 \,{\left (315 \, \sqrt{g x + f} a d^{2} + \frac{210 \,{\left ({\left (g x + f\right )}^{\frac{3}{2}} - 3 \, \sqrt{g x + f} f\right )} a d e}{g} + \frac{21 \,{\left (3 \,{\left (g x + f\right )}^{\frac{5}{2}} - 10 \,{\left (g x + f\right )}^{\frac{3}{2}} f + 15 \, \sqrt{g x + f} f^{2}\right )} c d^{2}}{g^{2}} + \frac{21 \,{\left (3 \,{\left (g x + f\right )}^{\frac{5}{2}} - 10 \,{\left (g x + f\right )}^{\frac{3}{2}} f + 15 \, \sqrt{g x + f} f^{2}\right )} a e^{2}}{g^{2}} + \frac{18 \,{\left (5 \,{\left (g x + f\right )}^{\frac{7}{2}} - 21 \,{\left (g x + f\right )}^{\frac{5}{2}} f + 35 \,{\left (g x + f\right )}^{\frac{3}{2}} f^{2} - 35 \, \sqrt{g x + f} f^{3}\right )} c d e}{g^{3}} + \frac{{\left (35 \,{\left (g x + f\right )}^{\frac{9}{2}} - 180 \,{\left (g x + f\right )}^{\frac{7}{2}} f + 378 \,{\left (g x + f\right )}^{\frac{5}{2}} f^{2} - 420 \,{\left (g x + f\right )}^{\frac{3}{2}} f^{3} + 315 \, \sqrt{g x + f} f^{4}\right )} c e^{2}}{g^{4}}\right )}}{315 \, g} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2*(c*x^2+a)/(g*x+f)^(1/2),x, algorithm="giac")

[Out]

2/315*(315*sqrt(g*x + f)*a*d^2 + 210*((g*x + f)^(3/2) - 3*sqrt(g*x + f)*f)*a*d*e/g + 21*(3*(g*x + f)^(5/2) - 1
0*(g*x + f)^(3/2)*f + 15*sqrt(g*x + f)*f^2)*c*d^2/g^2 + 21*(3*(g*x + f)^(5/2) - 10*(g*x + f)^(3/2)*f + 15*sqrt
(g*x + f)*f^2)*a*e^2/g^2 + 18*(5*(g*x + f)^(7/2) - 21*(g*x + f)^(5/2)*f + 35*(g*x + f)^(3/2)*f^2 - 35*sqrt(g*x
 + f)*f^3)*c*d*e/g^3 + (35*(g*x + f)^(9/2) - 180*(g*x + f)^(7/2)*f + 378*(g*x + f)^(5/2)*f^2 - 420*(g*x + f)^(
3/2)*f^3 + 315*sqrt(g*x + f)*f^4)*c*e^2/g^4)/g